import Me from '@/dll/me'
export default {
  data () {
    return {
    }
  },
  methods: {
    // 取消订单
    async onCancel (item) {
      this.$vux.loading.show({
        text: '请稍后'
      })
      let res = await Me.cancelInPurchasingOrderVerify(item.purchase_order_id)
      this.$vux.loading.hide()
      if (res.code == 0) {
        this.$router.push({
          name: 'orderCancel',
          query: { item: JSON.stringify(item), reason: res.data }
        })
      } else {
        this.$vux.alert.show({
          title: '提示',
          content: res.msg
        })
      }
    },
    // 支付订单
    async onPay (item) {
      // eslint-disable-next-line no-unused-vars
      let param = [item.order_sn]
      this.$router.push({
        name: 'payIng',
        query: {
          isOrder: true
        },
        params: { sn: [item.order_sn] }
      })
    }
  }
}
